In [1]:
#import inportant libraries
import pandas as pd
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
In [2]:
#read the data\
data = pd.read_csv("Downloads/Screentime-App-Details.csv")
print(data.head())
         Date  Usage  Notifications  Times opened        App
0  08/26/2022     38             70            49  Instagram
1  08/27/2022     39             43            48  Instagram
2  08/28/2022     64            231            55  Instagram
3  08/29/2022     14             35            23  Instagram
4  08/30/2022      3             19             5  Instagram
In [4]:
#Check if dataset has null values
data.isnull().sum()
Out[4]:
Date             0
Usage            0
Notifications    0
Times opened     0
App              0
dtype: int64
In [5]:
#Dataset has no null values
#Check the descriptive statistics
print(data.describe())
            Usage  Notifications  Times opened
count   54.000000      54.000000     54.000000
mean    65.037037     117.703704     61.481481
std     58.317272      97.017530     43.836635
min      1.000000       8.000000      2.000000
25%     17.500000      25.750000     23.500000
50%     58.500000      99.000000     62.500000
75%     90.500000     188.250000     90.000000
max    244.000000     405.000000    192.000000
In [6]:
#Analyze the screentime of the user
#Will look at the amount of usage of the apps

figure = px.bar(data_frame = data,
               x = "Date",
               y = "Usage",
               color = "App",
               title = "Usage")
figure.show()
In [8]:
#Now look at the number of notifications from the apps

figure = px.bar(data_frame = data,
               x = "Date",
               y = "Notifications",
               color = "App",
               title = "Notifications")
figure.show()
In [10]:
#Now look at the number of times the apps are opened
figure = px.bar(data_frame = data,
               x = "Date",
               y = "Times opened",
               color = "App",
               title = "Times Opened")
figure.show()
In [14]:
#Let's look at the relationship between the number of notifications and the amount of usage

figure = px.scatter(data_frame = data,
                   x = "Notifications",
                   y = "Usage",
                   size = "Notifications",
                   trendline = "ols",
                   title = "Relationship between Number of Notifications and Usage")
figure.show()
In [ ]:
#There’s a linear relationship between the number of notifications and the amount of usage.
#It means that more notifications result in more use of smartphones.
In [ ]:
#Summary
#Screen Time Analysis is the task of analyzing and creating a report on which applications and 
#websites are used by the user for how much time.